Generic Programming with Concepts
نویسنده
چکیده
Generic programming is an indispensable ingredient of modern programming languages. In the C++ programming language, generic programming is implemented by the means of parameterized fragments of code, called templates, in which parameters are constrained by concepts. This thesis consists of six publications investigating different aspects of generic programming with concepts—formal semantics of the concepts language feature, the mathematical foundations of concepts as a specification tool, change impact analysis of generic libraries, and multi-paradigm, multi-language library development. Formally specifying the semantics of programming languages is a difficult task, one that is taken up rarely due to its complexity. In this thesis we provide a formal semantics of the separate type checking with concepts. We also describe some potential problems we discovered while translating the informal wording into formal rules. A formal semantics, such as ours, makes it easier to discuss language design, to improve the quality of the informal specification, and may serve as a model for compilers and other tools. Concepts as institutions is another view on the semantics of concepts we provide in this thesis. Institutions describe the parts of logics: signatures are the vocabulary, sentences are phrases that can be said given a vocabulary, and models are the subjects of the phrases. The institutions of concepts we provide make concepts into logics; the most basic general institution frames concepts as signatures and concept maps as sentences and models at the same time. The logic view on concepts makes it possible to apply techniques from the field of algebraic specification in the realm of C++ programming. Generic programming with concepts also requires more practical support: in this thesis we describe a conceptual change impact analysis for generic libraries. Our change impact analysis is applied at the specification level of a generic library, which comprises the underlying concept hierarchy and generic interfaces of library functions and data structures. We apply the analysis to a real and important problem, a proposed change to the iterator concepts hierarchy of the Standard Template Library of C++. Finally, we consider multi-paradigm development of generic libraries. We investigate how the datatype-generic paradigm applies to an imperative language such as C++: we provide a possible solution and outline the important differences between C++ and a functional language that must be taken into account. We also consider similarities between generic programming in Haskell and C++: based on a particular library we provide a translation from Haskell generic interfaces to the corresponding interfaces in C++.
منابع مشابه
Generic Programming: Controlling Static Specialization with Concepts in C++
Generic programming is a powerful technique for its possibility to design software components parameterized on types (and static values for some languages), and not only on dynamic values. Like in object-oriented programming, the mechanism of specialization, defined here as "static" for generic programming and "dynamic" for object-oriented programming, makes the technique particularly interesti...
متن کاملA Formalization of Concepts for Generic Programming
Generic programming is a paradigm for systematic design and classification of software components for optimal reuse. It has been the guiding methodology behind the design of the C++ Standard Template Library and numerous other C++ libraries. Generic programming starts with algorithms, seeking to identify the minimal requirements on types necessary for correct and efficient execution of an algor...
متن کاملMathematical Programming Models for Solving Unequal-Sized Facilities Layout Problems - a Generic Search Method
This paper present unequal-sized facilities layout solutions generated by a genetic search program named LADEGA (Layout Design using a Genetic Algorithm). The generalized quadratic assignment problem requiring pre-determined distance and material flow matrices as the input data and the continuous plane model employing a dynamic distance measure and a material flow matrix are discussed. Computa...
متن کاملGeometry Template Library for STL-like 2D Operations
There is a proliferation of geometric algorithms and data types with no existing mechanism to unify geometric programming in C++. The geometry template library (GTL) provides geometry concepts and concept mapping through traits as well as algorithms parameterized by conceptual geometric data type to provide a unified library of fundamental geometric algorithms that is interoperable with existin...
متن کاملA Survey on Different Solution Concepts in Multiobjective Linear Programming Problems with Interval Coefficients
Optimization problems have dedicated a branch of research to themselves for a long time ago. In this field, multiobjective programming has special importance. Since in most real-world multiobjective programming problems the possibility of determining the coefficients certainly is not existed, multiobjective linear programming problems with interval coefficients are investigated in this paper. C...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2008